home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 026-050 / scopedisk45 / dlabel / stuff.c < prev   
C/C++ Source or Header  |  1995-03-18  |  806b  |  53 lines

  1. #include <stdio.h>
  2. #include <functions.h>
  3.  
  4. #define FALSE      (0)
  5. #define TRUE       (-1)
  6.  
  7. #ifdef DEBUG
  8. char *libs[] =
  9. {
  10.    "intuition.library",
  11.    "graphics.library",
  12.    NULL
  13. };
  14.  
  15. void *IntuitionBase = NULL;
  16. void *GfxBase = NULL;
  17. unsigned long endBases = NULL;
  18. #endif
  19.  
  20. int openLibs(names,bases)
  21. char **names; void **bases;
  22. {
  23.    int rval = TRUE;
  24.  
  25.    while (*names)
  26.    {
  27.        *bases = (void *)OpenLibrary(*(names++),0L);
  28.        if (!(*(bases++))) {rval = FALSE; break;}
  29.    }
  30.    return(rval);
  31. }
  32.  
  33. int closeLibs(bases)
  34. void **bases;
  35. {
  36.    while (*bases)
  37.    {
  38.        CloseLibrary(*(bases++));
  39.    }
  40. }
  41.  
  42. #ifdef DEBUG
  43. main()
  44. {
  45.    int result;
  46.  
  47.    result = openLibs(libs,&IntuitionBase);
  48.    printf("IntuitionBase = %lx\nGfxBase = %lx\n",IntuitionBase,GfxBase);
  49.    closeLibs(&IntuitionBase);
  50.    exit(result);
  51. }
  52. #endif
  53.